<?php 

function checkLogin(){

	if(I('cookie.user')&&I('cookie.pwd')){
		//查询是否有该用户
		$user = M('user');
		$where['username'] = I('cookie.user');
        $info = $user->where($where)->find();
		//查到则验证密码
		if (!empty($info)) {
            if (I('cookie.pwd') == $info['password']){
				return true;
			}
		}
	}else{
		return false;
	}		
}



 ?>